<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            name: "张三",
            age: 18,
            gender: "男"
        }
        //将对象转换成JSON字符串
        var jsonstr = JSON.stringify(obj)
        console.log(jsonstr);

        var jsonstr1 = "[{\"fileBucket\":\"laboratory\",\"fileCode\":\"1706768328043\",\"fileObjectName\":\"1706768328043.jpg\",\"fileOriginName\":\"car.jpg\",\"fileSizeInfo\":\"382kb\",\"fileSizeKb\":382,\"fileSuffix\":\".jpg\",\"fileType\":1,\"fileUrl\":\"http://127.0.0.1:9091/files/1706768328043.jpg\",\"fileVersion\":1,\"secretFlag\":\"N\"},{\"fileBucket\":\"laboratory\",\"fileCode\":\"1706768328052\",\"fileObjectName\":\"1706768328052.png\",\"fileOriginName\":\"lab.png\",\"fileSizeInfo\":\"114kb\",\"fileSizeKb\":114,\"fileSuffix\":\".png\",\"fileType\":1,\"fileUrl\":\"http://127.0.0.1:9091/files/1706768328052.png\",\"fileVersion\":1,\"secretFlag\":\"N\"},{\"fileBucket\":\"laboratory\",\"fileCode\":\"1706768328052\",\"fileObjectName\":\"1706768328052.webp\",\"fileOriginName\":\"Laser-on-Chip-Art-Concept-777x518.webp\",\"fileSizeInfo\":\"84kb\",\"fileSizeKb\":84,\"fileSuffix\":\".webp\",\"fileUrl\":\"http://127.0.0.1:9091/files/1706768328052.webp\",\"fileVersion\":1,\"secretFlag\":\"N\"}]"
        //将JSON字符串转换成对象
        var obj1 = JSON.parse(jsonstr1)
        console.log(obj1);
    </script>
</body>

</html>